This Amazon S3 Personal File Store sample is fully detailed in the Mobile Credential Management article. The sample demonstrates how to customize the token vending machine to give application users specific and constrained permissions to an Amazon S3 bucket. Each application user will get a "folder" of an Amazon S3 bucket as specified by the modified policy. This README details all the steps necessary to get the sample fully running:
{"Statement":
[
{"Effect":"Allow","Action":["s3:PutObject","s3:GetObject","s3:DeleteObject"],"Resource":"arn:aws:s3:::__BUCKET_NAME__/__USERNAME__/*"},
{"Effect":"Allow","Action":"s3:ListBucket","Resource":"arn:aws:s3:::__BUCKET_NAME__","Condition":{"StringLike":{"s3:prefix":"__USERNAME__/"}}},
{"Effect":"Deny","Action":["iam:*", "sts:*", "sdb:*"],"Resource":"*"}
]
}
{"Statement":
[
{"Effect":"Allow","Action":["s3:PutObject","s3:GetObject","s3:DeleteObject"],"Resource":"arn:aws:s3:::my_s3_bucket/__USERNAME__/*"},
{"Effect":"Allow","Action":"s3:ListBucket","Resource":"arn:aws:s3:::my_s3_bucket","Condition":{"StringLike":{"s3:prefix":"__USERNAME__/"}}},
{"Effect":"Deny","Action":["iam:*", "sts:*", "sdb:*"],"Resource":"*"}
]
}
{
"Statement": [
{
"Effect": "Allow",
"Action": "sts:GetFederationToken",
"Resource": "*"
},
{
"Effect": "Allow",
"Action": "iam:GetUser",
"Resource": "*"
},
{
"Effect": "Allow",
"Action": ["s3:PutObject","s3:GetObject","s3:DeleteObject"],
"Resource": "arn:aws:s3:::__BUCKET_NAME__/*"
},
{
"Effect": "Allow",
"Action": ["s3:ListBucket"],
"Resource": "arn:aws:s3:::__BUCKET_NAME__"
},
{
"Effect": "Allow",
"Action": "sdb:*",
"Resource": "*"
}
]
}
{
"Statement": [
{
"Effect": "Allow",
"Action": "sts:GetFederationToken",
"Resource": "*"
},
{
"Effect": "Allow",
"Action": "iam:GetUser",
"Resource": "*"
},
{
"Effect": "Allow",
"Action": ["s3:PutObject","s3:GetObject","s3:DeleteObject"],
"Resource": "arn:aws:s3:::my_s3_bucket/*"
},
{
"Effect": "Allow",
"Action": ["s3:ListBucket"],
"Resource": "arn:aws:s3:::my_s3_bucket"
},
{
"Effect": "Allow",
"Action": "sdb:*",
"Resource": "*"
}
]
}